package com.rm.zeyou.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.rm.zeyou.entity.User;
import com.rm.zeyou.response.ApiRestResponse;
import com.rm.zeyou.service.LimitCouponMatchesConfigService;
import com.rm.zeyou.util.login.LoginUtil;
import com.rm.zeyou.vo.response.SelectLimitCouponMatchesListResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 限时优惠券场次表 前端控制器
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:08
 */
@Api(tags = "限时优惠券场次相关")
@RestController
@RequestMapping("/api/limitCouponMatchesConfig")
public class LimitCouponMatchesConfigController {
    @Resource
    private LimitCouponMatchesConfigService limitCouponMatchesConfigService;
    @Resource
    private LoginUtil loginUtil;

    @ApiOperation(value = "查询限时优惠券场次列表")
    @GetMapping("selectLimitCouponMatchesList")
    @SaCheckLogin(type = "user")
    public ApiRestResponse<List<SelectLimitCouponMatchesListResponseVo>> selectLimitCouponMatchesList() {
        User user = loginUtil.getUser();
        return limitCouponMatchesConfigService.selectLimitCouponMatchesList(user.getId());
    }
}
